# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-clone
pkgver=5.0.11
pkgrel=1
pkgdesc='Disk and partition backup/restore tool'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/deepin-clone"
license=('GPL3')
depends=('deepin-file-manager' 'deepin-qt5integration' 'partclone' 'e2fsprogs' 'jfsutils' 'xfsprogs')
makedepends=('cmake' 'ninja' 'qt5-tools' 'deepin-gettext-tools')
groups=('deepin-extra')
source=("$pkgname-$pkgver.tar.gz::https://github.com/linuxdeepin/deepin-clone/archive/$pkgver.tar.gz")
sha512sums=('eab0690a21549a64ac85830abbe3576b252a11cb95b0028fad430246d204a9fdd1733944a8bcac6bf4cb7cb994bde299ed9f01a229d0d7f0ebe3c53e9ff25ee6')

prepare() {
  cd deepin-clone-$pkgver
  sed -i 's|sbin|bin|' CMakeLists.txt
}

build() {
  cd deepin-clone-$pkgver
  cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=lib .
  ninja
}

package() {
  cd deepin-clone-$pkgver
  DESTDIR="$pkgdir" ninja install
}
